package com.example.train.infra.repository.impl;

import com.example.train.domain.entity.Department;
import com.example.train.domain.repository.DepartmentRepository;
import com.example.train.infra.mapper.DepartmentMapper;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @Author: chundong.huang@hand-china.com
 * @Date: 2023/3/25 15:37
 */
@Component
public class DepartmentRepositoryImpl implements DepartmentRepository {
    private final DepartmentMapper departmentMapper;

    public DepartmentRepositoryImpl(DepartmentMapper departmentMapper) {
        this.departmentMapper = departmentMapper;
    }

    @Override
    public List<Department> list(Long id) {
        return departmentMapper.list(id);
    }

    @Override
    public int del(Long id) {
        return departmentMapper.del(id);
    }

    @Override
    public int insert(Department department) {
        return departmentMapper.insert(department);
    }

    @Override
    public int update(Department department) {
        return departmentMapper.update(department);
    }
}
